<%--
	fileName      : usermgmt_usermgmt_memuPreview.jsp
	author        : kfzx-yuli1
	createDate    : 2010-6-10  上午12:52:23
	lastModifier  : kfzx-yuli1
	lastModifyDate: 2010-6-10  上午12:52:23
	description   : 请添加描述
--%>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="ctp-tag" prefix="ctp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>用户快捷菜单预览</title>
		<ctp:include items='toolbar,combobox,label,textfield'/>
		<script type='text/javascript' kind='variant'>	
			  
		    //================================UI变量定义片段============================================================
			var menuPreviewToolBar,menuPreviewCombobox,menuPreviewLabel;
	
		</script>		
		<script type='text/javascript' kind='event'>
            //================================函数定义片段============================================================
	
			var userId='<ctp:out name="userIdSel"/>';

			var branchId='<ctp:out name="flowCtx.branchId"/>';
			var branchLevel='<ctp:out name="flowCtx.branchLevel"/>';
			var roleId='<ctp:out name="roleIdSel"/>';
			var ctpcombobox;
			var currentroleid;

			var myurl;
				myurl='<ctp:url href="user.flowc" flowActionName="menupreviewop"/>&userId='+userId+'&branchId='+branchId+'&branchLevel='+branchLevel;

			function changerole(){	
					currentroleid=ctpcombobox.getValue();

					//ctpcombobox.setValue(currentroleid);
					
				//	document.all.GotoShortCutMenuList.userId.value='<ctp:out name="userId"/>';
				//	document.all.GotoShortCutMenuList.branchId.value='<ctp:out name="flowCtx.branchId"/>';
				//	document.all.GotoShortCutMenuList.branchLevel.value='<ctp:out name="flowCtx.branchLevel"/>';
					document.GotoShortCutMenuList.userIdSel.value=userId;
					document.GotoShortCutMenuList.roleIdSel.value=currentroleid;
					GotoShortCutMenuList.submit();
			}			
			 </script>    
			<script type='text/javascript' kind='ui'>
		    //================================UI组件定义片段============================================================		    
		    //ctp.core.log.lvl = ctp.core.loglvl.obj; //需要进行调试时启用
		    /**
             * 创建UI组件
             * @version	 1.0
             * @since	 1.0
             * @author	kfzx-yuli1           
             */		
			function initUI(){
				
				ctpcombobox =new ctp.ui.combobox({
					        	id: 'combobox1',
					        	width: '150px',
					        	remote: {url:myurl}	,
					        	value:roleId,
					        	onChange: changerole
					        }) ;
				
				menuPreviewToolBar=new ctp.ui.toolbar({
					id : 'menuPreviewToolBar',			
					border : 'bottom',			
	            	leftItems :[{
		                	id:"_toolbar_combobox1",
					        type : 'combobox',
					        text : '<ctp:label key="select_role" />',
					        object:ctpcombobox ,
		                	//name : 'roleInList',
		                	//text : '<ctp:label key="select_role" />',
		                	//items ：'<ctp:iterator name="roleInList" var="role"></ctp:iterator>',
		                	//disable : false,
		                	onClick : function(){
		                			//if(confirmModify()){
		                				//document.GotoShortCutMenuList.submit();
		                			//}           		
		                		}
		                }],             			
					renderTo:'form1'				   
			    });
				currentroleid=ctpcombobox.getValue();
			
		
			menuContent = $('#left').contents().find("body").html();
            $('#preMenu').html(menuContent);
			$('#left').hide();
			};
			
				
		</script>
		<link href="<ctp:out name='fullPath'/>css/menu.css" rel="stylesheet" type="text/css" />
		<style type="text/css">
		 .icon-open{
 			width:16px;
			height:19px;
 			background: url(<ctp:out name='fullPath'/>/images/menu/icon_open.gif) no-repeat left 100% !important;
 			}
 		.icon-close{
 			width:16px;
 			height:19px;
 			background: url(<ctp:out name='fullPath'/>/images/menu/icon_close.gif) no-repeat left 100% !important;
 }
		
		</style>
	</head>
	<body onload="initUI();">
		<div id="form1"></div>
		<ctp:form name="GotoShortCutMenuList" method="post" action="user.flowc" flowActionName="changerolepreview">
				
				<ctp:set name="currentroleId" value="roleIdSel"/>
				<ctp:set name="userId" value="userIdSel"/>

			<input type="hidden" name="userIdSel"/>
			<input type="hidden" name="roleIdSel"/>
			<div id="preMenu">					
			</div>
			<iframe id="left" style="margin:0;padding:0;display:none;visibility:hidden;" MARGINHEIGHT="0" MARGINWIDTH="0" FRAMEBORDER="0" SCROLLING="auto"  height="356"
					SRC="<ctp:url href="getlogonmenu.flowc?flowActionName=process1" params="userId=userId;defaultRoleId=currentroleId;Language=sessCtx.Language;fullpath=fullPath;menuType='preMenu'"/>">
			</iframe>
		</ctp:form>
	</body>
</html>

<%--
	date        :
	modifyReason:
--%>